﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ComponentModel;
using System.IO;

namespace SDK10kWrapper
{
    public partial class CameraWPF : ICameraWPF
    {

        #region INSTANCE MEMBERs
        #region Online Property
        [DefaultValue("192.168.1.1"), Category(".Camera"), Description("Camera Server IP Address")]
        public string Online_IP { get { return _cambox.Online_IP; } set { _cambox.Online_IP = value; } }

        [DefaultValue("Admin"), Category(".Camera"), Description("Camera Server Username")]
        public string Online_UserName { get { return _cambox.Online_UserName; } set { _cambox.Online_UserName = value; } }

        [DefaultValue("123456"), Category(".Camera"), Description("Camera Server Password")]
        public string Online_Password { get { return _cambox.Online_Password; } set { _cambox.Online_Password = value; } }

        [Category(".Camera"), Description("Check if Camera is Recording")]
        public bool Online_IsRecording { get { return _cambox.Online_IsRecording; } }

        [Category(".Camera"), Description("Check if Camera is Connected to Server")]
        public bool Online_IsConnected { get { return _cambox.Online_IsConnected; } set { _cambox.Online_IsConnected = value; } }

        [DefaultValue("N/A"), Category(".Camera"), Description("Specify where to Save your Recording File")]
        public string Online_VideoSavePath { get { return _cambox.Online_VideoSavePath; } set { _cambox.Online_VideoSavePath = value; } }
        #endregion

        #region Offline Property
        [DefaultValue("N/A"), Category(".Camera"), Description("Specify where to Load your Video Playback File")]
        public string Offline_VideoPlayPath { get { return _cambox.Offline_VideoPlayPath; } set { _cambox.Offline_VideoPlayPath = value; } }
        #endregion

        #region Both Property
        /// <summary>
        /// Do not Set this Property in Runtime Code. Set this in Designer only for Synchronization or not
        /// </summary>
        [DefaultValue(CameraMode.Offline), Category(".Camera"), Description("Specify Camera Mode Operation")] //Browsable(false)
        public CameraSyncMode CameraSyncMode { get { return _cambox.CameraSyncMode; } set { _cambox.CameraSyncMode = value; } }

        [DefaultValue(CameraMode.Offline), Category(".Camera"), Description("Specify Camera Mode Operation")]
        public CameraMode CameraMode { get { return _cambox.CameraMode; } set { _cambox.CameraMode = value; } }

        [Category(".Camera"), Description("Check if Camera is Playing")]
        public bool IsPlaying { get { return _cambox.IsPlaying; } }

        [DefaultValue("N/A"), Category(".Camera"), Description("Specify where to Save your Capture File")]
        public string CapturePath { get { return _cambox.CapturePath; } set { _cambox.CapturePath = value; } }

        #endregion
        #endregion

        #region METHODS
        #region Online Method
        /// <summary>
        /// CONNECT TO THIS CAMERA (server) & READY TO GET DATA.
        /// </summary>
        /// <returns>TRUE if connect SUCCESS otherwise FALSE</returns>
        public bool Connect() { return _cambox.Connect(); }

        /// <summary>
        /// DISCONNECT FROM THIS CAMERA (server) & STOP GETTING DATA.
        /// </summary>
        /// <returns>TRUE if disconnect SUCCESS otherwise FALSE</returns>
        public bool Disconnect() { return _cambox.Disconnect(); }

        /// <summary>
        /// <para>START RECORDING THIS CAMERA IN REALTIME TO A FILE.</para>
        /// <para>To change File Path set the Online_SavePath</para>
        /// </summary>
        /// <returns>TRUE if record SUCCESS otherwise FALSE</returns>
        public bool StartRecord() { return _cambox.StartRecord(); }

        /// <summary>
        /// STOP RECORDING THIS CAMERA &amp; RETURN THE FILEINFO.
        /// </summary>
        /// <returns>VALID FileInfo if record SUCCESS otherwise NULL</returns>
        public FileInfo StopRecord() { return _cambox.StopRecord(); }
        #endregion
        #region Offline Method

        #endregion
        #region Both Method

        /// <summary>
        /// <para>PLAY THIS CAMERA (depend on CameraMode you set).</para>
        /// <para>Offline will playback movie setted in Offline_FilePath, Online will play streaming realtime from server</para>
        /// </summary>
        /// <returns>TRUE if play SUCCESS otherwise FALSE</returns>
        public bool Play() { return _cambox.Play(); }

        /// <summary>
        /// <para>PAUSE THIS CAMERA (depend on CameraMode you set).</para>
        /// <para>Offline will pause movie setted in Offline_FilePath, Online will pause streaming realtime from server</para>
        /// </summary>
        /// <returns>TRUE if pause SUCCESS otherwise FALSE</returns>
        public bool Pause() { return _cambox.Pause(); }

        /// <summary>
        /// <para>STOP THIS CAMERA (depend on CameraMode you set).</para>
        /// <para>Offline will stop movie setted in Offline_FilePath, Online will stop streaming realtime from server</para>
        /// </summary>
        /// <returns>TRUE if stop SUCCESS otherwise FALSE</returns>
        public bool Stop() { return _cambox.Stop(); }

        /// <summary>
        /// TURN ON SOUND DURING PLAYING CAMERA
        /// </summary>
        /// <returns>TRUE if on sound SUCCESS otherwise FALSE</returns>
        public bool SoundON() { return _cambox.SoundON(); }

        /// <summary>
        /// TURN OFF SOUND DURING PLAYING CAMERA
        /// </summary>
        /// <returns>TRUE if off sound SUCCESS otherwise FALSE</returns>
        public bool SoundOFF() { return _cambox.SoundOFF(); }

        /// <summary>
        /// Capture Entire Camera Frame into .PNG file
        /// </summary>
        /// <param name="savePath">File Path to save PNG capture into</param>
        /// <returns>null if Capture Fail otherwise a FileInfo</returns>
        public FileInfo Capture(string savePath) { return _cambox.Capture(savePath); }

        /// <summary>
        /// Capture Entire Camera Frame into .PNG File set in CapturePath
        /// </summary>
        /// <returns>null if Capture Fail otherwise a FileInfo</returns>
        public FileInfo Capture() { return _cambox.Capture(); }
        #endregion
        #endregion

    }
}
